<?php
/**
 * Created by PhpStorm.
 * User: dapeng
 * Date: 2018/11/22
 * Time: 下午3:26
 */

namespace app\models\Project_1_0;


use Core\Model;

class Student extends Model
{


    //查询所有的学生信息
    function all(){
        //连接数据库 (直接交给框架);
        //组合SQL语句
        $sql = "select * from t_student";
        //执行SQL语句
        $res = $this->db->fetch_sql($sql);
        //拿到结果
        return $res;
    }


    //学生数据
    function save($data){
        return $this->db->insert("t_student",$data);
    }


}